//
//  LinkViewController.m
//  A段项目
//
//  Created by 月月 on 15/4/14.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "LinkViewController.h"
#import "UIImageView+WebCache.h"

@interface LinkViewController ()<UIWebViewDelegate>

@end

@implementation LinkViewController

- (void)dealloc
{
    [_dic release];
    [super dealloc];
}

-(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        self.dic = [NSDictionary dictionary];
    }    
    return self;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self.view setBackgroundColor:[UIColor whiteColor]];
    UIWebView *webView = [[UIWebView alloc] init];
    webView.frame = CGRectMake(0, -45, self.view.frame.size.width, self.view.frame.size.height - 44);
    webView.delegate = self;
    // 伸缩页面至填充整个webView
    webView.scalesPageToFit = YES;
    // 隐藏scrollView
    webView.scrollView.hidden = YES;
    [self.view addSubview:webView];
    
    // 2.加载网页
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:[self.dic objectForKey:@"link_wechat"]]];
    [webView loadRequest:request];
    
    
   // 关闭弹簧
    webView.scrollView.bounces = NO;
    
    // 显示scrollView
    webView.scrollView.hidden = NO;

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
